<?php
/**
 * Created by PhpStorm.
 * User: lizx
 * Date: 2018/1/30
 * Time: 12:25
 */

namespace app\common\Server;

use app\common\Service;

class Validate extends Service
{
    /**
     * 验证手机号
     * @param $phone
     * @return bool|string
     */
    public function getPhone($phone)
    {
        $phone = str_replace('-', '', $phone);
        if (!preg_match('/1\d{10}$/', $phone)) {
            return false;
        }
        return substr($phone, -11);
    }

}